<template>
  <div>
    <a-form layout="horizontal">
      <a-form-item
        label="付款账户"
        :label-col="formItemLaout.labelCol"
        :wrapper-Col="formItemLaout.warpperCol"
      >
        {{ step.payAccount}}
      </a-form-item>
       <a-form-item
        label="密码"
        :label-col="formItemLaout.labelCol"
        :wrapper-Col="formItemLaout.warpperCol"
      >
        <a-input
          v-decorator="[
            'password',
            {
              initiaValue: step.password,
              rules: [{ required: true, message: '请输入密码' }],
            },
          ]"
          type="password"
          placeholder="请输入付款账户"
        />
       </a-form-item>
      <a-form-item>
          <a-button style="margin-right:20px;color:white" type="primary" @click="onPre"> 上一步 </a-button>
        <a-button type="primary" @click="handleSubmit"> 下一步 </a-button>
      </a-form-item>
    </a-form>
  </div>
</template>

<script>
export default {
  data() {
    this.form = this.$form.createForm(this);
    return {
      formItemLaout: {
        labelCol: { span: 4 },
        warpperCol: { span: 14 },
      },
    };
  },
  computed: {
    step() {
      return this.$store.state.form.step;
    },
  },
  methods: {
    handleSubmit() {
      const { form,  $store ,step} = this;
      form.validateFields((err, values) => {
        if (!err) {
          $store.dispatch({
            type: "form/submitStepForm",
            payload: {...step,...values},
          });
        }
      });
    },
    onPre()
    {
       this.$router.push("/form/step-form")
    }
  },
};
</script>

<style>
</style>